package com.itlong.cloud.property.resource;

import com.itlong.cloud.POJO.DTO.property.PropertyArrearPeopleManageDTO;
import com.itlong.cloud.POJO.VO.property.PropertyArrearPeopleManageVO;
import com.itlong.cloud.paymenthub.IPropertyArrearPeopleManageServiceClient;
import com.itlong.cloud.property.service.IPropertyArrearPeopleManageService;
import com.itlong.cloud.utils.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <desc>
 *      欠费人员管理接口暴露实现类
 * </desc>
 *
 * @createDate 2019/05/22
 */
@RestController
public class PropertyArrearPeopleManageServiceResource implements IPropertyArrearPeopleManageServiceClient {

    @Autowired
    private IPropertyArrearPeopleManageService iPropertyArrearPeopleManageService;

    /**
     * <desc>
     *      分页获取欠费人员管理信息
     * </desc>
     *
     * @param propertyArrearPeopleManageDTO 欠费人员管理DTO
     * @return 欠费人员管理分页信息
     * @author wangzhi
     * @createDate 2019/05/22
     */
    @Override
    @PostMapping("/property/arrearagePeopleManage/getPage")
    public Page<PropertyArrearPeopleManageVO> getPage(@RequestBody PropertyArrearPeopleManageDTO propertyArrearPeopleManageDTO) throws Exception {
        return iPropertyArrearPeopleManageService.getPage(propertyArrearPeopleManageDTO);
    }

    /**
     * <desc>
     *      欠费人员管理添加地址
     * </desc>
     *
     * @param propertyArrearPeopleManageDTO 欠费人员管理DTO
     * @return 受影响行数
     * @author wangzhi
     * @createDate 2019/05/22
     */
    @Override
    @PostMapping("/property/arrearagePeopleManage/save")
    public Integer save(@RequestBody PropertyArrearPeopleManageDTO propertyArrearPeopleManageDTO) throws Exception {
        return iPropertyArrearPeopleManageService.save(propertyArrearPeopleManageDTO);
    }

    /**
     * <desc>
     *      获取导出的欠费人员管理信息
     * </desc>
     *
     * @param propertyArrearPeopleManageDTO 欠费人员管理DTO
     * @return 欠费人员管理列表信息
     * @author wangzhi
     * @createDate 2019/05/22
     */
    @Override
    @PostMapping("/property/arrearagePeopleManage/getExportData")
    public List<PropertyArrearPeopleManageVO> getExportData(@RequestBody PropertyArrearPeopleManageDTO propertyArrearPeopleManageDTO) throws Exception {
        return iPropertyArrearPeopleManageService.getExportData(propertyArrearPeopleManageDTO);
    }

    /**
     * <desc>
     *      获取项目绑定的分润规则类型
     * </desc>
     *
     * @param projectId 项目id
     * @return 项目绑定的分润规则类型
     * @author wangzhi
     * @createDate 2019/06/12
     */
    @Override
    @PostMapping("/property/arrearagePeopleManage/getProjectProfitType")
    public String getProjectProfitType(@RequestParam("projectId") String projectId) throws Exception {
        return iPropertyArrearPeopleManageService.getProjectProfitType(projectId);
    }
}
